home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 26 (Anniversary Edition)
/
Volume 26 [Anniversary Edition] - JOGO DISK .iso
/
Fight
/
bandit_kings.swf
/
scripts
/
DefineSprite_66
/
frame_1
/
DoAction.as
Wrap
Text File
|
2006-07-26
|
800b
|
36 lines
if(_parent._x < -300)
{
if(_root.finished != true)
{
_parent._x = 600;
}
}
else
{
_parent._x -= _root.speed_caravan;
}
i = 1;
while(i < 3)
{
if((_root["p" + i]._x - 90 < _parent._x && _parent._x < _root["p" + i]._x + 60 && _root["p" + i]._xscale < 0 || _parent._x < _root["p" + i]._x + 90 && _root["p" + i]._x - 60 < _parent._x && 0 < _root["p" + i]._xscale) && _root["p" + i].attacking == true)
{
_root["p" + i].attacking = false;
_parent.hp--;
_root.s_hit2.start();
_parent.caravan.play();
}
i++;
}
if(_parent.hp == 0)
{
_parent.hp = 20;
if(random(4) == 1)
{
_root.drop_loot("chest",_parent._x,_parent._y - 10);
}
else
{
_root.drop_loot("bag",_parent._x,_parent._y - 10);
}
}